package com.weike.test;

import com.weike.test.mapper.BaseMapper;
import com.weike.test.service.CustomerService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Bean;

import java.util.List;
import java.util.Map;

@MapperScan("com.weike.test.mapper")
@SpringBootApplication
public class McpApplication {

    @Autowired
    private BaseMapper baseMapper;

    public static void main(String[] args) {
        SpringApplication.run(McpApplication.class, args);

    }


    @Bean
    public ToolCallbackProvider weatherTools(CustomerService customerService) {
        return MethodToolCallbackProvider.builder().toolObjects(customerService).build();
    }



}
